package ncc.bs.utils;

import nc.bs.framework.common.NCLocator;
import nc.itf.uap.busibean.ISysInitQry;
import nc.vo.pub.BusinessException;
import nc.vo.pubapp.pattern.exception.ExceptionUtils;

/**
 * <p>第三方系统工具类</p>
 * 
 * @author Administrator
 * @date 2023年7月12日
 *
 */
public class GetParamConfigUtil {
	private static final String LogName = "oalog";
	
	/**
	 * 查询集团参数
	 * 
	 * @param code
	 * @return
	 */
	public static String queryGroupSysParam(String code) {
		String initData = null;
		try {
			ISysInitQry sysInitQry = NCLocator.getInstance().lookup(ISysInitQry.class);
			initData = sysInitQry.getParaString("GLOBLE00000000000000", code);// 根据参数代码和集团获取参数值
		} catch (BusinessException e) {
			InputLogger.error(LogName,"根据代码获取集团参数【" + code + "】异常：" + e.getMessage());
			ExceptionUtils.wrappBusinessException("根据代码获取集团参数【" + code + "】异常：" + e.getMessage());
		}catch (Exception e) {
			InputLogger.error(LogName,"根据代码获取集团参数【" + code + "】异常：" + e.getMessage());
		}
		return initData;
	}
	public static String queryGroupSysParam(String pk_group,String code) {
		String initData = null;
		try {
			ISysInitQry sysInitQry = NCLocator.getInstance().lookup(ISysInitQry.class);
			initData = sysInitQry.getParaString(pk_group, code);// 根据参数代码和集团获取参数值
		} catch (BusinessException e) {
			InputLogger.error(LogName,"根据代码获取集团参数【" + code + "】异常：" + e.getMessage());
			ExceptionUtils.wrappBusinessException("根据代码获取集团参数【" + code + "】异常：" + e.getMessage());
		}catch (Exception e) {
			InputLogger.error(LogName,"根据代码获取集团参数【" + code + "】异常：" + e.getMessage());
		}
		return initData;
	}
}